package com.bailian.spring.ioc.basic_factorybean.config;

import com.bailian.spring.ioc.basic_factorybean.bean.Child;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author gaoxu
 * date: Created on 2021/11/1 下午1:39
 */
@Configuration
public class FactoryBeanConfig {

    @Bean
    public Child child() {
        return new Child();
    }

    @Bean
    public ToyFactoryBean toyFactoryBean() {
        ToyFactoryBean toyFactoryBean = new ToyFactoryBean();
        toyFactoryBean.setChild(child());
        return toyFactoryBean;
    }
}
